package com.itbaizhan.controller;

import com.itbaizhan.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author spf
 * @date 2024/4/23
 * @time 10:01
 */
@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private OrderService orderService;

    @GetMapping("/submitOrder")
    public String submitOrder(@RequestParam("productId") Long productId, @RequestParam("payCount") Integer payCount){
        orderService.submitOrder(productId, payCount);
        return "下单成功！";
    }
}
